import request from '@/utils/request'


// 客户查询 ==========================
// 查询客户列表
export function listCustom(query) {
  return request({
    url: '/system/custom/list',
    method: 'get',
    params: query
  })
}

// 查询客户详细
export function getCustom(customId) {
  return request({
    url: '/system/custom/' + customId,
    method: 'get'
  })
}

// 新增客户
export function addCustom(data) {
  return request({
    url: '/system/custom',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateCustom(data) {
  return request({
    url: '/system/custom',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delCustom(customId) {
  return request({
    url: '/system/custom/' + customId,
    method: 'delete'
  })
}

// 供应商查询 ==========================
// 查询客户列表
export function listSupplier(query) {
  return request({
    url: '/system/supplier/list',
    method: 'get',
    params: query
  })
}

// 查询客户详细
export function getSupplier(customId) {
  return request({
    url: '/system/supplier/' + customId,
    method: 'get'
  })
}

// 新增客户
export function addSupplier(data) {
  return request({
    url: '/system/supplier',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateSupplier(data) {
  return request({
    url: '/system/supplier',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delSupplier(customId) {
  return request({
    url: '/system/supplier/' + customId,
    method: 'delete'
  })
}


// 供应商类型查询 ==========================
// 查询客户列表
export function listSupplierCategory(query) {
  return request({
    url: '/system/supplier_category/list',
    method: 'get',
    params: query
  })
}

// 查询客户详细
export function getSupplierCategory(customId) {
  return request({
    url: '/system/supplier_category/' + customId,
    method: 'get'
  })
}

// 新增客户
export function addSupplierCategory(data) {
  return request({
    url: '/system/supplier_category',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateSupplierCategory(data) {
  return request({
    url: '/system/supplier_category',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delSupplierCategory(customId) {
  return request({
    url: '/system/supplier_category/' + customId,
    method: 'delete'
  })
}


// 代理机构查询 ==========================
// 查询客户列表
export function listAgent(query) {
  return request({
    url: '/system/agent/list',
    method: 'get',
    params: query
  })
}

// 查询客户详细
export function getAgent(customId) {
  return request({
    url: '/system/agent/' + customId,
    method: 'get'
  })
}

// 新增客户
export function addAgent(data) {
  return request({
    url: '/system/agent',
    method: 'post',
    data: data
  })
}

// 修改客户
export function updateAgent(data) {
  return request({
    url: '/system/agent',
    method: 'put',
    data: data
  })
}

// 删除客户
export function delAgent(customId) {
  return request({
    url: '/system/agent/' + customId,
    method: 'delete'
  })
}
